// import {getComponentList} from "@/api/dict";
import { getDict } from '@/api/common'

export const operateList = [
  {
    name: $i18n.t('common.add'),
    type: 'primary',
    icon: 'el-icon-circle-plus-outline',
    handleName: 'add', //点击时返回的标识
  }
]
export const rowConfig = [
  {
    name: '编辑',
    type: 'primary',
    class: 'row-btn-primary',
    handleName: 'edit', //点击时返回的标识
  },

  {
    name: '删除',
    type: 'danger',
    class: 'row-btn-danger',
    handleName: 'delete', //点击时返回的标识
  }
]
export const subRowConfig = [
  {
    name: '编辑',
    type: 'primary',
    class: 'row-btn-primary',
    handleName: 'editSub', //点击时返回的标识
  },

  {
    name: '删除',
    type: 'danger',
    class: 'row-btn-danger',
    handleName: 'deleteSub', //点击时返回的标识
  }
]
// 主表查询条件
export const formConfig = {
  inline: true,
  formDesc: {
    // component: {
    //   type: 'select',
    //   label: $i18n.t('dict.component'),
    //   prop: {
    //     text: 'sysName',
    //     value: 'sysCode'
    //   },
    //   options: async (data) => {
    //     const list = await getComponentList()
    //     return list.data.result
    //   },
    //   layout: 6
    // },
    orderTypeName: {
      type: 'input',
      label: '订单类型名称',
      layout: 6
    }
    // orderTypeCode: {
    //   type: 'input',
    //   label: '订单类型编码',
    //   layout: 6
    // }
    // systemFlag: {
    //   type: 'select',
    //   label: $i18n.t('dict.systemFlag'),
    //   layout: 6,
    //   options: () => {
    //     return [
    //       {
    //         text: $i18n.t('common.yes'),
    //         value: '1'
    //       },
    //       {
    //         text: $i18n.t('common.no'),
    //         value: '0'
    //       }
    //     ]
    //   }
    // }
  }
}
export const formDescDialog = {
  span: 24,
  formDesc: {
    orderTypeName: {
      type: 'input',
      label: '订单类型名称',
      layout: 24
    },
    orderTypeCode: {
      type: 'input',
      label: '订单类型编码',
      layout: 24
    }
  }
}
export const formConfigDialog = {
  span: 24,
  formDesc: {
    systemFlag: {
      type: 'select',
      label: $i18n.t('dict.systemFlag'),
      layout: 24,
      required: true,
      options: (data) => {
        return [
          {
            text: $i18n.t('common.yes'),
            value: '1'
          },
          {
            text: $i18n.t('common.no'),
            value: '0'
          }
        ]
      }
    }
  }
}
export const formDescDialogSub = {
  span: 24,
  formDesc: {
    orderTypeName: {
      type: 'input',
      label: '分类名称',
      layout: 24,
      required: true
    },
    orderTypeCode: {
      type: 'input',
      label: '分类编码',
      layout: 24,
      required: true
    },
    recheckDicId: {
      type: 'select',
      prop: {
        value: 'id',
        text: 'description'
      },
      label: '复检项',
      layout: 24,
      attrs: {
        multiple: true
      },
      required: true,
      options: async (data) => {
        const list = await getDict('mes_pick_up_recheck_type')
        return list.data.result
      }
    },
    sequence: {
      type: 'number',
      label: '排序',
      layout: 24,
      required: true,
      attrs: {
        max: 9999,
        min: 0,
        precision: 0
      }
    }
  }
}
export const sub2RowConfig = [
  {
    name: '删除',
    type: 'danger',
    class: 'row-btn-danger',
    handleName: 'deleteSub2', //点击时返回的标识
    auth: 'auth:dict:delete' //权限字段
  }
]
